<template>
	<div>
		<h3>hello world</h3>
		<button @click="btnClick">axios初体验</button>
		<button @click="btnClick1">axios参数</button>
		<button @click="btnClick2">axios all</button>
	</div>
</template>

<script>
import axios from 'axios'
export default {
	name: 'App',
	components: {},
	created() {},
	methods: {
		btnClick() {
			axios.get('http://127.0.0.1:3000/cuifan').then((res) => {
				console.log(res)
			})
		},
		btnClick1() {
			axios
				.get('http://127.0.0.1:3000/simon', {
					params: {
						uname: 'cuifan',
					},
				})
				.then((res) => {
					console.log(res)
				})
		},
		btnClick2() {
			axios
				.all([
					axios.get('http://127.0.0.1:3000/cuifan'),
					axios.get('http://127.0.0.1:3000/simon', {
						params: {
							uname: 'cuifan',
						},
					}),
				])
				.then((data) => {
					console.log(data)
				})
		},
	},
}
</script>

<style>
</style>
</style>
</style>